<template>
  <el-card shadow="never">
    <define-modal @refresh="handleRefresh" ref="defineModal" />
    <el-tooltip class="item" effect="dark" content="新增项目定义" placement="top">
      <el-button
        size="small"
        type="primary"
        class="fr mb20"
        @click="handleEdit(false, {})"
        icon="el-icon-plus"
      />
    </el-tooltip>
    <define-table @edit="handleEdit" ref="defineTable" />
  </el-card>
</template>

<script>
import DefineTable from './DefineTable'
import DefineModal from './DefineModal'

export default {
  components: {
    DefineTable,
    DefineModal
  },
  methods: {
    handleEdit(bool, obj) {
      this.$refs.defineModal.edit(bool, obj)
    },
    handleRefresh() {
      this.$refs.defineTable.handleGetList()
    }
  }
}
</script>
